/*
* @Author: root
* @Date:   2017-11-29 22:42:38
* @Last Modified by:   root
* @Last Modified time: 2017-12-04 21:46:07
*/
/*
* @Author: root
* @Date:   2017-11-29 21:14:27
* @Last Modified by:   root
* @Last Modified time: 2017-11-29 21:14:51
*/
'use strict';

var _utils = require('util/util.js');

var _address = {
   
    // 获取地址列表
    getAddressList : function(resolve, reject){
        _utils.request({
            url     : _utils.getServerUrl('/shipping/list.do'),
            data 	:{
            	pageSize : 50
            },
            success : resolve,
            error   : reject
        });
    },
    //新增收件人地址
    save : function(addressInfo,resolve,reject){
        _utils.request({
            url     : _utils.getServerUrl('/shipping/add.do'),
            data    : addressInfo,
            success : resolve,
            error   : reject
        });
    },
    //获取单条收件人信息
    getAddress : function(shippingId,resolve,reject){
         _utils.request({
                    url     : _utils.getServerUrl('/shipping/select.do'),
                    data    : {
                        shippingId : shippingId
                    },
                    success : resolve,
                    error   : reject
                });
    },
    //更新收件人
    update : function(addressInfo,resolve,reject){
        _utils.request({
                    url     : _utils.getServerUrl('/shipping/update.do'),
                    data    : addressInfo,
                    success : resolve,
                    error   : reject
                });
    },
    //删除收件人的地址信息
    //获取单条收件人信息
    deleteAddress : function(shippingId,resolve,reject){
         _utils.request({
                    url     : _utils.getServerUrl('/shipping/del.do'),
                    data    : {
                        shippingId : shippingId
                    },
                    success : resolve,
                    error   : reject
                });
    },
        
}
module.exports = _address;